/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package requestManager;

import java.awt.Component;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import lib.JButtonTable.ButtonEditor;

/**
 *
 * @author yoshi
 */
public class ApproveButtonEditor extends ButtonEditor {

    public ApproveButtonEditor(JCheckBox checkBox, final AbstractRequestManager myView) {
        super(checkBox);

        final ApproveButtonEditor self = this;

        this.button.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                new Thread() {

                    @Override
                    public void run() {
                        myView.getMyController().approve(((ApproveButtonModel)self.getCellEditorValue()).getRequest());
                    }
                }.start();
            }
        });
    }
}
